Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

SUBMARINE-1361. Fix Submarine SQL injection vulnerability #1037

Closed
wants to merge 1 commit into from

Conversation

cdmikechen
Copy link
Contributor

What is this PR for?

Currently a SQL injection vulnerability has been checked in submarine and the relevant part of the like statement in mybatis needs to be fixed.

What type of PR is it?

Bug Fix

Todos

  • - replace like statement to concat('%', #{param}, '%')

What is the Jira issue?

https://issues.apache.org/jira/browse/SUBMARINE-1361

How should this be tested?

Added a test case verification code in submarine-server/server-database/src/test/java/org/apache/submarine/server/database/workbench/database/service/SysUserServiceTest.java

Screenshots (if appropriate)

NA

Questions:

  • Do the license files need updating? No
  • Are there breaking changes for older versions? No
  • Does this need new documentation? No

@codecov
Copy link

codecov bot commented Jan 7, 2023

Codecov Report

Merging #1037 (34fb34b) into master (6d18d55) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1037   +/-   ##
=======================================
  Coverage   75.98%   75.98%           
=======================================
  Files         119      119           
  Lines        5000     5000           
=======================================
  Hits         3799     3799           
  Misses       1201     1201           
Flag Coverage Δ
python-integration 59.72% <ø> (ø)
python-unit 52.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@asfgit asfgit closed this in 4cd2af1 Jan 16, 2023
cdmikechen added a commit to shangyuantech/submarine that referenced this pull request Feb 5, 2023
### What is this PR for?
Currently a SQL injection vulnerability has been checked in submarine and the relevant part of the `like` statement in mybatis needs to be fixed.

### What type of PR is it?
Bug Fix

### Todos
* [x] - replace `like` statement to `concat('%', #{param}, '%')`

### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-1361

### How should this be tested?
Added a test case verification code in `submarine-server/server-database/src/test/java/org/apache/submarine/server/database/workbench/database/service/SysUserServiceTest.java`

### Screenshots (if appropriate)
NA

### Questions:
* Do the license files need updating? No
* Are there breaking changes for older versions? No
* Does this need new documentation? No

Author: cdmikechen <cdmikechen@apache.org>

Signed-off-by: cdmikechen <cdmikechen@apache.org>

Closes apache#1037 from cdmikechen/SUBMARINE-1361 and squashes the following commits:

34fb34b [cdmikechen] Avoid sql injection
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant